package fun.tan90.trace.model;

import lombok.Getter;

import java.util.Date;
import java.util.Objects;

@Getter
public class HeadingData extends BaseData {

    /**
     * 航向(°)
     */
    private final Integer gpsDirection;

    /**
     * 磁偏角
     */
    private final Float declination;

    public HeadingData(Date ts, Integer gpsDirection, Float declination) {
        super(ts);
        this.gpsDirection = gpsDirection;
        this.declination = declination;
    }


    @Override
    public Double calValue() {
        return Objects.nonNull(gpsDirection) ? gpsDirection * 1.0 : null;
    }
}